- content_for :title do
  = @title

- content_for :section_title do
  = @title

.row
  .col-md-12
    .card.system_info
      .card-header
        h3.card-title
          i.fas.fa-info-circle
          |  设备信息
      .card-body
        .pl-2.pr-2
          - if @device
            .alert.alert-success
              strong Woo-ha！
              | 本设备已注册
              - if @device.name.present?
               | 【
               = @device.name
               | 】
              | ，快往下看看有没有关联的应用吧！
          - else
            .alert.alert-warning
              strong Ta-Da！
              | 发现一台未注册的设备，复制 UDID 给 iOS 工程师哦！

        dl.system-info
          dt UDID
          dd
            .input-group.mb-3
              input#udid-text.form-control.rounded-0 value="#{params[:udid]}" readonly="true"
              span.input-group-append
                button.btn.btn-success.btn-flat.btn-clipboard data-clipboard-target="#udid-text"
                  i.far.fa-clipboard
          dt 型号
          dd
            .input-group.mb-3
              input#product-text.form-control.rounded-0 value="#{params[:product]}" readonly="true"
              span.input-group-append
                button.btn.btn-success.btn-flat.btn-clipboard data-clipboard-target="#product-text"
                  i.far.fa-clipboard
          dt 序列号
          dd
            .input-group.mb-3
              input#serial-text.form-control.rounded-0 value="#{params[:serial]}" readonly="true"
              span.input-group-append
                button.btn.btn-success.btn-flat.btn-clipboard data-clipboard-target="#serial-text"
                  i.far.fa-clipboard
          dt 版本
          dd
            .input-group.mb-3
              input#version-text.form-control.rounded-0 value="#{params[:version]}" readonly="true"
              span.input-group-append
                  button.btn.btn-success.btn-flat.btn-clipboard data-clipboard-target="#version-text"
                    i.far.fa-clipboard

  .col-md-12
    .card
      .card-header
        h3.card-title
          i.fas.fa-cubes
          |  可安装应用
      .card-body
        - if @device && @device.channels.present?
          .timeline
            - @device.channels.each do |channel|
              ruby:
                release = channel.latest_release
              div
                i.far.fa-circle
                .timeline-item
                  span.time
                    i.fas.fa-clock
                    | &nbsp
                    = time_ago_in_words(release.created_at)
                  h3.timeline-header
                    = link_to release.app_name, channel_release_path(channel, release)
                    = " 上传了新版本 #{release.release_version} (#{release.build_version})"
                  - if release.changelog.present?
                    .timeline-body.pb-0
                      = changelog_format release.changelog_list, class: 'mb-0'
                  - if release.release_type.present? || release.branch.present? || release.short_git_commit.present?
                    .timeline-footer
                      - if release.release_type.present?
                        small.badge
                          = release.release_type
                      - if release.branch.present?
                        small.badge
                          = release.branch
                      - if release.short_git_commit.present?
                        small.badge
                          - if release.channel.git_url.present?
                            = git_commit_url(channel.git_url, release.git_commit)
                          - else
                            = release.short_git_commit
            div
              i.fas.fa-clock.bg-gray
        - else
          .p-2
            p
              strong 没有发现可安装应用！
              | 请复制上面设备 UDID 并发给 iOS 工程师来添加测试设备并重新打包。
              | 新安装包上传之后可以刷新本页面检查是否出现对应的应用。

